#include <Python.h>
#include "IMoodRingEntry.h"

extern IMoodRingEntry* g_Entry;

static PyObject* MoodRingMain(PyObject* self, PyObject* args)
{
	PyObject * pyfile; 
	int uid, fileType;
	if (PyArg_ParseTuple(args, "i|i|O", &uid, &fileType, &pyfile)) { 
		FILE * cfile = PyFile_AsFile(pyfile);
		return Py_BuildValue("i", g_Entry->MR_Entry(uid, fileType, cfile));
	}
	return NULL;
}

static PyMethodDef MoodRingPythonMethods[]=
{
	{"MoodRingMain", MoodRingMain, METH_VARARGS, "Mood Ring Project, C++ Entry Function" },
	{NULL, NULL, 0, NULL}
};

PyMODINIT_FUNC initMoodRingPython()
{
	Py_InitModule("MoodRingPython", MoodRingPythonMethods);
}